﻿using Messhall.Domain.Permission.BusinessObjects;
using Messhall.Framework.Repository.Repositorys;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Messhall.Repository.Permission.EntityTypeConfigurations
{
    public class AccountEntityConfiguration : EntityTypeConfigurationBase<AccountEntity>
    {
        public override void Configure(EntityTypeBuilder<AccountEntity> builder)
        {
            builder.ToTable("account");
            builder.Property(c => c.UsersKeyId).IsRequired();
            builder.Property(c => c.Type).HasMaxLength(4).IsRequired();
            builder.Property(c => c.OpenCode).HasMaxLength(20).IsRequired();

            base.Configure(builder);
        }
    }
}
